package com.hzh;

import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;

import java.io.IOException;
import java.io.StringReader;

public class WordCount {
    public static void main(String[] args) throws IOException {
        IKSegmenter ikSegmenter = new IKSegmenter(new StringReader("从小被寄养在姨丈家里的哈利波特饱受姨丈一家人的歧视与欺侮"), true);
        Lexeme lexeme = null;
        while ((lexeme = ikSegmenter.next()) != null){
            System.out.println(lexeme.getLexemeText());
        }
    }
}